import * as TYPE from './type';
import {toGet, toPost} from '../../utils/MyAxios';
import {Notice} from 'iview';

/*获取工作计划列表*/
export const getWorkPlanList = ({commit},params) => {
  toGet('/work-plan/wp/queryAll/'+JSON.stringify(params))
    .then((response) => {
      if (response.resultCode === 0) {
        let responseData=response.data;
        commit(TYPE.WORKPLAN, {
          list:responseData.list,
          total:responseData.total,
          currentPage:responseData.currentPage,
          pageSize:responseData.pageSize,
        });
      }
      else {
        Notice.error({
          title: '获取工作计划列表失败',
          desc: response.resultMsg
        });
      }
    });
};
